package com.luchao.back.service.impl;

import com.luchao.back.mapper.FriendLinksMapper;
import com.luchao.back.pojo.FriendLinks;
import com.luchao.back.service.FriendLinksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FriendLinksServiceImpl implements FriendLinksService {

    @Autowired
    private FriendLinksMapper friendLinksMapper;

    @Override
    public List<FriendLinks> getFriendLinksByPage(int startNum, int pageSize) {
        return friendLinksMapper.getFriendLinksByPage((startNum - 1) * pageSize, pageSize);
    }

    @Override
    public long getFriendLinksCount() {
        return friendLinksMapper.getFriendLinksCount();
    }

    @Override
    public int checkFlinks(String flname) {
        return friendLinksMapper.checkFlinks(flname);
    }

    @Override
    public int addFlinks(FriendLinks friendLinks) {
        return friendLinksMapper.addFlinks(friendLinks);
    }

    @Override
    public int deleteFlinks(Integer flid) {
        return friendLinksMapper.deleteFlinks(flid);
    }

    @Override
    public boolean batchDeleteFlinks(List<FriendLinks> friendLinks) {
        return friendLinksMapper.batchDeleteFlinks(friendLinks) > 0 ? true : false;
    }

}
